from django.utils.translation import ugettext as _
from django.contrib.auth.models import User, Group
from django.contrib.auth.admin import UserAdmin, GroupAdmin

from django.contrib.sites.models import Site
from django.contrib.sites.admin import SiteAdmin

from django.contrib.flatpages.models import FlatPage
from django.contrib.flatpages.admin import FlatPageAdmin

from sorl import curator as admin


class UserAdmin(admin.ModelAdmin, UserAdmin):
    pass

class GroupAdmin(admin.ModelAdmin, GroupAdmin):
    pass

class SiteAdmin(admin.ModelAdmin, SiteAdmin):
    pass
    # description = _("Administer all the different sites here.")
    
class FlatPageAdmin(admin.ModelAdmin, FlatPageAdmin):
    pass


admin.site.layout = (
    (_('Campaigns'), {
            'models': ('chimichanga.banner_viewer.models',
                'Campaign',
            ),
      }),
      (_('Concepts'), {
            'models': ('chimichanga.banner_viewer.models',
                'Concept',
            ),
      }),
    (_('Banners'), {
        'models': ('chimichanga.banner_viewer.models',
            'Banner',
        ),
    }),
    (_('Page Templates'), {
         'models': ('chimichanga.banner_viewer.models',
             'Page_Template',
         ),
     }),
    (_('Trusted Users & Groups'), {
        'models': ('django.contrib.auth.models',
            'User', 'Group'
        )
    }),
    # (_("Don't touch this stuff, unless you know what you are doing"), {
    #     'models': ('django.contrib.sites.models',
    #         'Site',
    #     ),
    # }),
    # (_('Flat Pages (For simple html pages)'), {
    #     'models': ('django.contrib.flatpages.models',
    #         'FlatPage',
    #     )
    # }),

)


admin.site.register(User, UserAdmin)
admin.site.register(Group, GroupAdmin)
admin.site.register(Site, SiteAdmin)
admin.site.register(FlatPage, FlatPageAdmin)